package com.google.samples.apps.jetpackapp.app;

import android.util.Log;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;

import com.google.samples.apps.jetpackapp.utils.Logger;

/**
 * Created by Administrator on 2021/7/6 0006.
 * Describe:
 */
public class ApplicationObserver implements LifecycleObserver {

    /**
     * 初始化
     * 在应用程序的整个生命周期只会调用一次
     */
    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    public void onCreate() {
        Logger.d();
    }


    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    public void onStart() {
        Logger.d();
    }


    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    public void onResume() {
        Logger.d();
    }


    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    public void onPause() {
        Logger.d();
    }


    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    public void onStop() {
        Logger.d();
    }


    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    public void onDestroy() {
        Logger.d();
    }


}
